package com.rabbiter.ordering.mapper;

import com.rabbiter.ordering.entity.Params;
import com.rabbiter.ordering.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where username = #{username}")
    User selectByUsername(String username);

    void insert(User user);

    void deleteById(Integer id);

    void updateById(User user);

    @Select("select * from user where id =#{id}")
    User selectById(Integer id);

    List<User> findAll(@Param("params")Params params);

}
